|
|
This may be a bit much on this subject, but here is some code showing how a
Torus macro might work. I am not happy with having to declare the variables for
the normals outside the macro, but don't have time to really think about it
right now. The cleanest way would be to just remember that normal y is 0, x is 1
and z is 2, but I wanted a clearer version for this example.
#include "colors.inc"
camera { location <0, 1, -10> look_at 0}
light_source {<5,10,-20> White}
// This would go in the include file
#declare Y=0;
#declare X=1;
#declare Z=2;
#macro Torus(Maj,Min,Nor,Loc)
torus {Maj,Min
#switch(Nor)
#case(0)
#break
#case(1)
rotate z*90
#case(2)
rotate x*-90
#end
translate Loc}
#end
//This would go in the scene file
object {Torus(3,.2,Y,<2,2,5>)
pigment {Red}}
Post a reply to this message
|
|